//截取字符串
function truncate(str,size){
  //转为数组
  let array = [...str]
  let res = array.slice(0,size)+'...'
  return res

}
